import request from '@/utils/request'

export function getDepartmentApi (data) {
  return request({
    url: '/company/department',
    method: 'get',
    data
  })
}

/**
 * 新增部门
 * **/
export function addDepartments (data) {
  return request({
    url: '/company/department', // restful接口规范
    method: 'post',
    data // axios的body参数 data
  })
}

/**
 * 编辑部门
 * **/
export function editDepartments (data) {
  return request({
    url: `/company/department/${data.id}`, // restful接口规范
    method: 'put',
    data // axios的body参数 data
  })
}

/**
 * 删除部门
 * **/
export function delDepartments (id) {
  return request({
    url: `/company/department/${id}`, // restful接口规范
    method: 'delete'
  })
}